package AnalizadorSintactico;

import javax.swing.tree.DefaultMutableTreeNode;

import AnalizadorLexico.Lexema;

public class Asignacion extends Sentencia {

	private Lexema id;
	private Lexema asignacion;
	private Expresion exp;

	public Asignacion(Lexema id, Lexema asignacion, Expresion exp) {
		this.id = id;
		this.asignacion = asignacion;
		this.exp = exp;
	}

	@Override
	public DefaultMutableTreeNode getSubArbol() {
		DefaultMutableTreeNode nodo = new DefaultMutableTreeNode(this);
		return nodo;
	}

	@Override
	public String toString() {
		String asig = "";
		asig += id.getLexema() + " " + asignacion.getLexema() + " ";
		if (exp != null) {
			asig += exp.toString();
		}
		return "asignacion: " + asig;
	}

	public Lexema getId() {
		return id;
	}

	public Expresion getExp() {
		return exp;
	}



}
